package Control;

import Command.Cd;
import Command.Copy;
import Command.Dir;
import Command.Exit;
import Command.MkDir;
import Command.Move;
import Command.Search;
import Command.Tree;

public class Factory {
	public ICommandExecutor getCommandExecuterexecute(String command)
	{
		ICommandExecutor cmdRun = null;
		String[] cmd = command.split(" ");
		if("dir".equals(cmd[0]))
			cmdRun = Dir.getInstance();
		if("find".equals(cmd[0]))
			cmdRun = Search.getInstance();
		if("tree".equals(cmd[0]))	
			cmdRun = Tree.getInstance();
		if("exit".equals(cmd[0]))
			cmdRun = Exit.getInstance();
		if("mkdir".equals(cmd[0]))
			cmdRun = MkDir.getInstance();
		if("copy".equals(cmd[0]))
			cmdRun = Copy.getInstance();
		if("move".equals(cmd[0]))
			cmdRun = Move.getInstance();
		if("cd".equals(cmd[0]))
			cmdRun = Cd.getInstance();
		return cmdRun;
	}
}
